Optimal. Leaf size=26 \[ \frac{\tanh ^{-1}\left (\frac{\cos (x)-\sin (x)}{\sqrt{2}}\right )}{\sqrt{2}}-\tanh ^{-1}(\cos (x)) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0744782, antiderivative size = 26, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 9, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.556, Rules used = {3518, 3110, 3770, 3074, 206} \[ \frac{\tanh ^{-1}\left (\frac{\cos (x)-\sin (x)}{\sqrt{2}}\right )}{\sqrt{2}}-\tanh ^{-1}(\cos (x)) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3518
Rule 3110
Rule 3770
Rule 3074
Rule 206
Rubi steps
\begin{align*} \int \frac{\csc (x)}{1+\tan (x)} \, dx &=\int \frac{\cot (x)}{\cos (x)+\sin (x)} \, dx\\ &=\int \left (\csc (x)+\frac{1}{-\cos (x)-\sin (x)}\right ) \, dx\\ &=\int \csc (x) \, dx+\int \frac{1}{-\cos (x)-\sin (x)} \, dx\\ &=-\tanh ^{-1}(\cos (x))-\operatorname{Subst}\left (\int \frac{1}{2-x^2} \, dx,x,-\cos (x)+\sin (x)\right )\\ &=-\tanh ^{-1}(\cos (x))-\frac{\tanh ^{-1}\left (\frac{-\cos (x)+\sin (x)}{\sqrt{2}}\right )}{\sqrt{2}}\\ \end{align*}
Mathematica [C] time = 0.0413579, size = 41, normalized size = 1.58 \[ \log \left (\sin \left (\frac{x}{2}\right )\right )-\log \left (\cos \left (\frac{x}{2}\right )\right )+(1+i) (-1)^{3/4} \tanh ^{-1}\left (\frac{\tan \left (\frac{x}{2}\right )-1}{\sqrt{2}}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.025, size = 26, normalized size = 1. \begin{align*} -\sqrt{2}{\it Artanh} \left ({\frac{\sqrt{2}}{4} \left ( 2\,\tan \left ( x/2 \right ) -2 \right ) } \right ) +\ln \left ( \tan \left ({\frac{x}{2}} \right ) \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.85027, size = 68, normalized size = 2.62 \begin{align*} \frac{1}{2} \, \sqrt{2} \log \left (-\frac{\sqrt{2} - \frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1}{\sqrt{2} + \frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} - 1}\right ) + \log \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.35363, size = 203, normalized size = 7.81 \begin{align*} \frac{1}{4} \, \sqrt{2} \log \left (\frac{2 \,{\left (\sqrt{2} + \cos \left (x\right )\right )} \sin \left (x\right ) - 2 \, \sqrt{2} \cos \left (x\right ) - 3}{2 \, \cos \left (x\right ) \sin \left (x\right ) + 1}\right ) - \frac{1}{2} \, \log \left (\frac{1}{2} \, \cos \left (x\right ) + \frac{1}{2}\right ) + \frac{1}{2} \, \log \left (-\frac{1}{2} \, \cos \left (x\right ) + \frac{1}{2}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\csc{\left (x \right )}}{\tan{\left (x \right )} + 1}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.29647, size = 59, normalized size = 2.27 \begin{align*} \frac{1}{2} \, \sqrt{2} \log \left (\frac{{\left | -2 \, \sqrt{2} + 2 \, \tan \left (\frac{1}{2} \, x\right ) - 2 \right |}}{{\left | 2 \, \sqrt{2} + 2 \, \tan \left (\frac{1}{2} \, x\right ) - 2 \right |}}\right ) + \log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) \right |}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]